/**
 * @author fei
 * @time 2022-12-28
 * @description 实现路由定义
 */

import Vue from 'vue'
import Router from 'vue-router'
import intercepter from './interceptor'
import routes from './routes'

// 全局插件注册
Vue.use(Router)

const router = new Router({
    // 指定路由模式
    mode:'history',
    // 配置路由
    routes:[
        // 做的后台系统，没有注册页面，进入系统一定要登录
        {path:'/',redirect:'/login'},
        {path:'/login',component:()=>import('../views/login/index.vue'),meta:{nologin:true,layout: 'BlankLayout'}},
        ...routes
    ]
}) 

router.beforeEach(intercepter)

export default router